home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / Developer Essentials May91 / MPW Interfaces & Libraries 3.2 / AIncludes / ScriptEqu.a < prev    next >
Encoding:
Text File  |  1991-04-17  |  49.4 KB  |  1,439 lines  |  [TEXT/MPS ]

  1. ; Version: 3.18
  2. ; Created: Friday, October 20, 1989 at 9:46:43 PM
  3. ;
  4. ; File ScriptEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1986-1990
  8. ; All Rights Reserved
  9. ;
  10. ; -----------------------------------------------------------------------------
  11. ; Script Manager equates file.
  12. ;
  13. ; This file contains all equates for the script environment, shared
  14. ; equates for the script interface systems, equates that are special for
  15. ; the Roman Interface System, and all equates for the script interface
  16. ; system package.
  17. ; -----------------------------------------------------------------------------
  18. ;
  19.  
  20.     IF &TYPE('__IncludingScriptEqu__') = 'UNDEFINED' THEN
  21. __IncludingScriptEqu__    SET    1
  22. ; -----------------------------------------------------------------------------
  23.  
  24. ; Script System constants.
  25.  
  26. smSystemScript    EQU            -1                        ; designates system script                <23>
  27. smCurrentScript    EQU            -2                        ; designates current font script        <27><33>
  28.  
  29. smRoman           EQU         0                         ; Roman
  30. smJapanese        EQU         1                         ; Japanese
  31. smTradChinese     EQU         2                         ; Traditional Chinese                    <14>
  32. smKorean          EQU         3                         ; Korean
  33. smArabic          EQU         4                         ; Arabic
  34. smHebrew          EQU         5                         ; Hebrew
  35. smGreek           EQU         6                         ; Greek
  36. smCyrillic        EQU            7                        ; Cyrillic                                <3>
  37. smRSymbol         EQU         8                         ; Right-left symbols
  38. smDevanagari      EQU         9                         ; Devanagari
  39. smGurmukhi        EQU         10                        ; Gurmukhi
  40. smGujarati        EQU         11                        ; Gujarati
  41. smOriya           EQU         12                        ; Oriya
  42. smBengali         EQU         13                        ; Bengali
  43. smTamil           EQU         14                        ; Tamil
  44. smTelugu          EQU         15                        ; Telugu
  45. smKannada         EQU         16                        ; Kannada/Kanarese
  46. smMalayalam       EQU         17                        ; Malayalam
  47. smSinhalese       EQU         18                        ; Sinhalese
  48. smBurmese         EQU         19                        ; Burmese
  49. smKhmer           EQU         20                        ; Khmer/Cambodian
  50. smThai            EQU         21                        ; Thai
  51. smLaotian         EQU         22                        ; Laotian
  52. smGeorgian        EQU         23                        ; Georgian
  53. smArmenian        EQU         24                        ; Armenian
  54. smSimpChinese   EQU         25                        ; Simplified Chinese                    <14>
  55. smTibetan         EQU         26                        ; Tibetan
  56. smMongolian       EQU         27                        ; Mongolian
  57. smGeez            EQU            28                        ; Geez/Ethiopic                            <1.6>
  58. smEthiopic        EQU            28                        ; Synonym for smGeez                    <20>
  59. smEastEurRoman    EQU         29                        ; Extended Roman for Slavic & Baltic langs    <21>
  60. smVietnamese      EQU         30                        ; Extended Roman for Vietnamese
  61. smExtArabic        EQU            31                        ; Extended Arabic for Sindhi, etc.        <21>
  62. smUninterp        EQU         32                        ; uninterpreted symbols, e.g. palette symbols
  63.  
  64. ; Obsolete names for script systems (kept for backward compatibility).
  65.  
  66. smChinese         EQU         2                         ; (use smTradChinese or smSimpChinese).    <14>
  67. smRussian        EQU            7                        ; (old name for smCyrillic).
  68. ;smMaldivian       EQU         25                        ; (no more smMaldivian!)                <14>
  69. smAmharic        EQU            28                        ; (old name for smGeez)
  70. smSlavic          EQU         29                        ; (old name for smEastEurRoman)
  71. smSindhi          EQU         31                        ; (old name for smExtArabic)            <21>
  72.  
  73. ; Language codes - moved to LanguageEqu.a                                                    <21>
  74.  
  75. ; Calendar Codes
  76.  
  77. calGregorian      EQU         0
  78. calArabicCivil    EQU         1
  79. calArabicLunar    EQU         2
  80. calJapanese       EQU         3
  81. calJewish         EQU         4
  82. calCoptic         EQU         5
  83. calPersian        EQU            6                        ;                                            <19> 
  84.  
  85. ; Integer Format Codes
  86.  
  87. intWestern        EQU         0
  88. intArabic         EQU         1
  89. intRoman          EQU         2
  90. intJapanese       EQU         3
  91. intEuropean       EQU         4
  92. intOutputMask     EQU         $8000
  93.  
  94. ; CharByte byte types.
  95.  
  96. smSingleByte      EQU         0
  97. smFirstByte       EQU         -1
  98. smLastByte        EQU         1
  99. smMiddleByte      EQU         2
  100.  
  101. ; CharType field masks
  102.  
  103. smcTypeMask            EQU        $000F
  104. smcReserved            EQU        $00F0
  105. smcClassMask        EQU        $0F00
  106. smcOrientationMask     EQU        $1000                    ; two-byte script glyph orientation            <27><33>
  107. smcRightMask        EQU        $2000
  108. smcUpperMask        EQU        $4000
  109. smcDoubleMask        EQU        $8000
  110.  
  111. ; Basic CharType character types.
  112.  
  113. smCharPunct       EQU         $0000
  114. smCharAscii       EQU         $0001
  115. smCharEuro        EQU         $0007
  116. smCharExtAscii    EQU         $0007                    ; More correct synonym for smCharEuro        <20>
  117.  
  118. ; Additional CharType character types for script systems.
  119.  
  120. smCharKatakana         EQU     $0002                     ; Japanese Katakana                            <32>
  121. smCharHiragana         EQU     $0003                     ; Japanese Hiragana                            <32>
  122. smCharIdeographic    EQU     $0004                     ; Hanzi, Kanji, Hanja                        <32>
  123. smCharTwoByteGreek    EQU     $0005                     ; 2-byte Greek in Far East systems            <32>
  124. smCharTwoByteRussian EQU     $0006                     ; 2-byte Cyrillic in Far East systems        <32>
  125. smCharBidirect        EQU        $0008                    ; Arabic, Hebrew                            <20>
  126. smCharHangul        EQU     $000C                     ; Korean Hangul                                <20><32>
  127. smCharJamo            EQU     $000D                     ; Korean Jamo                                <35>
  128. ; old names for above, for backward compatibility
  129. smCharFISKana         EQU     $0002                     ; Katakana
  130. smCharFISGana         EQU     $0003                     ; Hiragana
  131. smCharFISIdeo         EQU     $0004                     ; Hanzi, Kanji, Hanja
  132. smCharFISGreek        EQU     $0005                     ; 2-byte Greek in Far East systems
  133. smCharFISRussian    EQU     $0006                     ; 2-byte Cyrillic in Far East systems
  134.  
  135. ; CharType punctuation sub-types.
  136.  
  137. smPunctNormal     EQU         $0000
  138. smPunctNumber     EQU         $0100
  139. smPunctSymbol     EQU         $0200
  140. smPunctBlank      EQU         $0300                     ; NBSP is PunctNormal
  141.  
  142. ; CharType punctuation sub-types for two-byte systems                                            <27>
  143.  
  144. smPunctRepeat     EQU         $0400                     ; repeat marker                                <27><32><33>
  145. smPunctGraphic     EQU         $0500                     ; line graphics                                <27><32>
  146.  
  147. ; CharType Katakana and Hiragana sub-types for two-byte systems                                    <27>
  148.  
  149. smKanaSmall        EQU         $0100                     ; small kana character                        <27>
  150. smKanaHardOK    EQU         $0200                     ; can have dakuten                            <27>
  151. smKanaSoftOK    EQU         $0300                     ; can have dakuten or han-dakuten            <27>
  152.  
  153. ; CharType Ideographic sub-types for two-byte systems
  154.  
  155. smIdeographicLevel1    EQU     $0000                     ; level 1 char                                <32>
  156. smIdeographicLevel2    EQU     $0100                     ; level 2 char                                <32>
  157. smIdeographicUser    EQU     $0200                     ; user char                                    <32>
  158. ; old names for some of above, for backward compatibility
  159. smFISClassLvl1    EQU         $0000                     ; level 1 char                                <5><26>
  160. smFISClassLvl2    EQU         $0100                     ; level 2 char                                <5><26>
  161. smFISClassUser    EQU         $0200                     ; user char                                    <5><26>
  162.  
  163. ; CharType Jamo sub-types for Korean systems                                                    <35>
  164.  
  165. smJamoJaeum        EQU         $0000                     ; simple consonant char                        <35>
  166. smJamoBogJaeum    EQU         $0100                     ; complex consonant char                    <35>
  167. smJamoMoeum        EQU         $0200                     ; simple vowel char                            <35>
  168. smJamoBogMoeum    EQU         $0300                     ; complex consonant char                    <35>
  169.  
  170. ; CharType glyph orientation for two-byte systems                                                <27>
  171.  
  172. smCharHorizontal    EQU        $0000                    ; horizontal character form, or for both    <27>
  173. smCharVertical        EQU        $1000                    ; vertical character form                    <27>
  174.  
  175. ; CharType directions
  176.  
  177. smCharLeft        EQU         $0000
  178. smCharRight       EQU         $2000
  179.  
  180. ; CharType case modifers.
  181.  
  182. smCharLower       EQU         $0000
  183. smCharUpper       EQU         $4000
  184.  
  185. ; CharType character size modifiers (1 or multiple bytes).
  186.  
  187. smChar1byte       EQU         $0000
  188. smChar2byte       EQU         $8000
  189.  
  190. ; Char2Pixel directions.
  191.  
  192. smLeftCaret       EQU         0                         ; Place caret for left block.
  193. smRightCaret      EQU         -1                        ; Place caret for right block.
  194. smHilite          EQU         1                         ; Direction is TESysJust.
  195.  
  196. ; Transliterate target types for Roman.
  197.  
  198. smTransAscii      EQU         0                         ; convert to ASCII
  199. smTransNative     EQU         1                         ; convert to font script                <33>
  200. smTransCase       EQU         $FE                       ; convert case for all text
  201. smTransSystem     EQU         $FF                       ; convert to system script
  202.  
  203. ; Transliterate target types for two-byte scripts                                            <35>
  204.  
  205. smTransAscii1     EQU         2                         ; 1-byte Roman
  206. smTransAscii2     EQU         3                         ; 2-byte Roman
  207. smTransKana1      EQU         4                         ; 1-byte Japanese Katakana
  208. smTransKana2      EQU         5                         ; 2-byte Japanese Katakana
  209. ; (no 1-byte hiragana)
  210. smTransGana2      EQU         7                         ; 2-byte Japanese Hiragana
  211. smTransHangul2        EQU     8                         ; 2-byte Korean Hangul                    <35>
  212. smTransJamo2        EQU     9                         ; 2-byte Korean Jamo                    <35>
  213. smTransBopomofo2    EQU     10                         ; 2-byte Chinese Bopomofo                <35>
  214.  
  215. ; Transliterate target modifiers.
  216.  
  217. smTransLower      EQU         $4000                    ; target becomes lowercase                <33>
  218. smTransUpper      EQU         $8000                    ; target becomes uppercase                <33>
  219.  
  220. ; Transliterate source mask - general.
  221.  
  222. smMaskAll         EQU         $FFFFFFFF                 ; Convert all text
  223.  
  224. ; Transliterate source masks for Roman.
  225.  
  226. smMaskAscii       EQU         $00000001                 ; 2^smTransAscii
  227. smMaskNative      EQU         $00000002                 ; 2^smTransNative
  228.  
  229. ; Transliterate source masks for two-byte scripts.                                            <35>
  230.  
  231. smMaskAscii1      EQU         $00000004                 ; 2^smTransAscii1
  232. smMaskAscii2      EQU         $00000008                 ; 2^smTransAscii2
  233. smMaskKana1       EQU         $00000010                 ; 2^smTransKana1
  234. smMaskKana2       EQU         $00000020                 ; 2^smTransKana2
  235. smMaskGana2       EQU         $00000080                 ; 2^smTransGana2
  236. smMaskHangul2    EQU         $00000100                 ; 2^smTransHangul2                        <35>
  237. smMaskJamo2        EQU         $00000200                 ; 2^smTransJamo2                        <35>
  238. smMaskBopomofo2    EQU         $00000400                 ; 2^smTransBopomofo2                    <35>
  239.  
  240. ; Result values from GetEnvirons, SetEnvirons, GetScript and SetScript calls.
  241.  
  242. smNotInstalled    EQU         0                         ; routine not available in script
  243. smBadVerb         EQU         -1                        ; Bad verb passed to a routine.
  244. smBadScript       EQU         -2                        ; Bad script code passed to a routine.
  245.  
  246. ; Values for script redraw flag                                                                    <23>
  247.  
  248. smRedrawChar    EQU            0                        ; redraw character only
  249. smRedrawWord    EQU            1                        ; redraw entire word (2-byte systems)
  250. smRedrawLine    EQU            -1                        ; redraw entire line (bidirectional systems)
  251.  
  252. ; Result values from StyledLineBreak
  253.  
  254. smBreakWord       EQU         0                         ; could break at word boundary
  255. smBreakChar       EQU         1                         ; had to break at char boundary
  256. smBreakOverflow   EQU         2                         ; text too short, width subtracted
  257.  
  258. ; -----------------------------------------------------------------------------
  259. ; GetEnvirons and SetEnvirons verbs.
  260. ; -----------------------------------------------------------------------------
  261.  
  262. smVersion         EQU         0                         ; Script Manager version number.            <33>
  263. smMunged          EQU         2                         ; Globals change count.
  264. smEnabled         EQU         4                         ; Count of enabled scripts, incl Roman.        <33>
  265. smBidirect        EQU         6                         ; At least one bidirectional script.        <33>
  266. smFontForce       EQU         8                         ; Force font flag.
  267. smIntlForce       EQU         10                        ; Force intl flag.
  268. smForced          EQU         12                        ; Script was forced to system script.        <33>
  269. smDefault         EQU         14                        ; Script was defaulted to Roman script.        <33>
  270. smPrint           EQU         16                        ; Printer action routine.
  271. smSysScript       EQU         18                        ; System script.
  272. smLastScript      EQU         20                        ; Last keyboard script.
  273. smKeyScript       EQU         22                        ; Keyboard script.
  274. smSysRef          EQU         24                        ; System folder refNum.
  275. smKeyCache        EQU         26                        ; Obsolete                                    <33>
  276. smKeySwap         EQU         28                        ; Swapping table handle.                    <33>
  277. smGenFlags        EQU         30                        ; general flags long
  278. smOverride        EQU         32                        ; script override flags
  279. smCharPortion     EQU         34                        ; Ch vs SpExtra proportion
  280. ; New for System 7.0:    <2.4>
  281. smDoubleByte    EQU            36                        ; Flag for double-byte script installed        <2.4>
  282. smKCHRCache        EQU            38                        ; Returns pointer to KCHR cache                <2.6>
  283. smRegionCode    EQU            40                        ; Returns current region code (verXxx)        <3>
  284.  
  285. ; -----------------------------------------------------------------------------
  286. ; GetScript and SetScript verbs.
  287. ; Note: verbs private to script systems are negative, while
  288. ; those general across script systems are non-negative
  289. ; -----------------------------------------------------------------------------
  290.  
  291. smScriptVersion    EQU         0                         ; Script software version.
  292. smScriptMunged    EQU         2                         ; Script entry changed count.
  293. smScriptEnabled    EQU         4                         ; Script enabled flag.
  294. smScriptRight     EQU         6                         ; Right to left flag.
  295. smScriptJust      EQU         8                         ; Justification flag.
  296. smScriptRedraw    EQU         10                        ; Word redraw flag.
  297. smScriptSysFond    EQU         12                        ; Preferred system font.
  298. smScriptAppFond    EQU         14                        ; Preferred Application font.
  299. smScriptBundle    EQU         16                        ; Beginning of itlb verbs.
  300. smScriptNumber    EQU         16                        ; Script itl0 id.
  301. smScriptDate      EQU         18                        ; Script itl1 id.
  302. smScriptSort      EQU         20                        ; Script itl2 id.
  303. smScriptFlags     EQU         22                        ; Script flags
  304. smScriptToken     EQU         24                        ; Script itl4 id.
  305. smScriptEncoding EQU         26                        ; id of optional itl5, if present.            <22>
  306. smScriptLang      EQU         28                        ; Current language for script
  307. smScriptNumDate    EQU         30                        ; Script Number/Date formats
  308. smScriptKeys      EQU         32                        ; Script KCHR id.
  309. smScriptIcon      EQU         34                        ; ID # of SICN or kcs#/kcs4/kcs8 suite.
  310. smScriptPrint     EQU         36                        ; Script printer action routine.
  311. smScriptTrap      EQU         38                        ; Trap entry pointer.
  312. smScriptCreator    EQU         40                        ; Script file creator.
  313. smScriptFile      EQU         42                        ; Script file name.
  314. smScriptName      EQU         44                        ; Script name.
  315. ; There is a hole here for old Kanji private verbs 46-76
  316.  
  317. ; New for System 7.0:    <1.9>
  318. smScriptMonoFondSize EQU      78                        ; default monospace FOND (hi) & size (lo)
  319. smScriptPrefFondSize EQU      80                        ; preferred FOND (hi) & size (lo)
  320. smScriptSmallFondSize EQU     82                        ; default small FOND (hi) & size (lo)
  321. smScriptSysFondSize EQU       84                        ; default system FOND (hi) & size (lo)
  322. smScriptAppFondSize EQU       86                        ; default application FOND (hi) & size (lo)    <9>
  323. smScriptHelpFondSize EQU       88                        ; default Help Mgr FOND (hi) & size (lo)    <9>
  324. smScriptValidStyles EQU       90                        ; mask of valid styles for script            <18>
  325. smScriptAliasStyle EQU       92                        ; style (set) to use for aliases            <18>
  326.  
  327. ; -----------------------------------------------------------------------------
  328. ; Negative verbs for KeyScript                                                                <13><23>
  329. ; -----------------------------------------------------------------------------
  330.  
  331. smKeyNextScript            EQU        -1            ; Switch to next available script
  332. smKeySysScript            EQU        -2            ; Switch to the system script
  333. smKeySwapScript            EQU        -3            ; Switch to previously-used script                    <19>
  334.  
  335. ; New for System 7.0
  336. smKeyNextKybd            EQU        -4            ; Switch to next keyboard in current keyscript
  337. smKeySwapKybd            EQU        -5            ; Switch to previously-used keyboard in current keyscript
  338.                                             ;    (smKeySwapKybd is not implemented in System 7.0)
  339. smKeyDisableKybds        EQU        -6            ; Disable keyboards not in system or Roman script    <23>
  340. smKeyEnableKybds        EQU        -7            ; Re-enable keyboards for all enabled scripts        <23>
  341.  
  342. ; Not currently implemented in System, may be implemented by script systems                        <19>
  343. ; (Renumbered smKeyNextInputMethod, smKeySwapInputMethod)                                        <23>
  344. smKeyToggleInline        EQU        -8            ; Toggle inline input for current keyscript
  345. smKeyToggleDirection    EQU        -9            ; Toggle default line direction (TESysJust)
  346. smKeyNextInputMethod    EQU        -10            ; Switch to next input method in current keyscript    <23>
  347. smKeySwapInputMethod    EQU        -11            ; Switch to last-used input method in cur keyscript    <23>
  348.  
  349. smKeyDisableKybdSwitch    EQU        -12            ; Disable switching from the current keyboard        <24>
  350. ; -----------------------------------------------------------------------------
  351. ; Bits in the smScriptFlags word (bits above 7 are non-static)
  352. ; -----------------------------------------------------------------------------
  353.  
  354. smsfIntellCP      EQU         0                         ; script has intelligent cut & paste
  355. smsfSingByte      EQU         1                         ; script has only single bytes
  356. smsfNatCase       EQU         2                         ; native chars have upper & lower case
  357. smsfContext       EQU         3                         ; script is contextual                        <33>
  358. smsfNoForceFont    EQU         4                         ; script will not force characters
  359. smsfB0Digits      EQU         5                         ; script has alternate digits at B0-B9
  360. smsfAutoInit    EQU            6                        ; auto initialize the script                <8>
  361. smsfForms         EQU         13                        ; uses contextual forms for letters
  362. smsfLigatures     EQU         14                        ; uses contextual ligatures
  363. smsfReverse       EQU         15                        ; reverses native text, right-left
  364.  
  365. ; -----------------------------------------------------------------------------
  366. ; Bits in the smGenFlags long. First (high-order) byte is set from itlc flags byte.
  367. ; -----------------------------------------------------------------------------
  368. smfShowIcon        EQU    31                                ; show icon even if only one script    
  369. smfDualCaret    EQU    30                                ; use dual caret for mixed direction text
  370. smfNameTagEnab    EQU    29                                ; reserved for internal use                    <16>
  371.  
  372. ; -----------------------------------------------------------------------------
  373. ; Roman script constants.
  374. ; -----------------------------------------------------------------------------
  375.  
  376. ; The following are here for backward compatibility, but should not be used.                    <19>
  377. ; This information should be obtained using GetScript.
  378. romanSysFond    EQU    $3FFF                            ; system font id number.
  379. romanAppFond    EQU    3                                ; application font id number.
  380. romanFlags        EQU    1<<smsfIntellCP+1<<smsfSingByte+1<<smsfNatCase    ; roman settings
  381.  
  382. ; Script Manager font equates.
  383.  
  384. smFondStart       EQU         $4000                     ; start from 16K.
  385. smFondEnd         EQU         $C000                     ; past end of range at 48K.
  386.  
  387. ; -----------------------------------------------------------------------------
  388. ; Simple script constants.
  389. ; -----------------------------------------------------------------------------
  390. smUprHalfCharSet    EQU        $80        ; first character code in upper half of Macintosh Character Set    <8>
  391.  
  392. ; -----------------------------------------------------------------------------
  393. ; Macintosh character set extensions
  394. ; -----------------------------------------------------------------------------
  395.  
  396. diaeresisUprY     EQU         $D9                       ; Ÿ
  397. fraction          EQU         $DA                       ; ⁄
  398. intlCurrency      EQU         $DB                       ; €
  399. leftSingGuillemet    EQU     $DC                       ; ‹
  400. rightSingGuillemet    EQU        $DD                       ; ›
  401. fiLigature        EQU         $DE                       ; fi
  402. flLigature        EQU         $DF                       ; fl
  403. dblDagger         EQU         $E0                       ; ‡
  404. centeredDot       EQU         $E1                       ; ·
  405. baseSingQuote     EQU         $E2                       ; ‚
  406. baseDblQuote      EQU         $E3                       ; „
  407. perThousand       EQU         $E4                       ; ‰
  408. circumflexUprA    EQU         $E5                       ; Â
  409. circumflexUprE    EQU         $E6                       ; Ê
  410. acuteUprA         EQU         $E7                       ; Á
  411. diaeresisUprE     EQU         $E8                       ; Ë
  412. graveUprE         EQU         $E9                       ; È
  413. acuteUprI         EQU         $EA                       ; Í
  414. circumflexUprI    EQU         $EB                       ; Î
  415. diaeresisUprI     EQU         $EC                       ; Ï
  416. graveUprI         EQU         $ED                       ; Ì
  417. acuteUprO         EQU         $EE                       ; Ó
  418. circumflexUprO    EQU         $EF                       ; Ô
  419. appleLogo         EQU         $F0                       ; 
  420. graveUprO         EQU         $F1                       ; Ò
  421. acuteUprU         EQU         $F2                       ; Ú
  422. circumflexUprU    EQU         $F3                       ; Û
  423. graveUprU         EQU         $F4                       ; Ù
  424. dotlessLwrI       EQU         $F5                       ; ı
  425. circumflex        EQU         $F6                       ; ˆ
  426. tilde             EQU         $F7                       ; ˜
  427. macron            EQU         $F8                       ; ¯
  428. breveMark         EQU         $F9                       ; ˘                                        <34>
  429. overDot           EQU         $FA                       ; ˙
  430. ringMark          EQU         $FB                       ; ˚                                        <34>
  431. cedilla           EQU         $FC                       ; ¸
  432. doubleAcute       EQU         $FD                       ; ˝
  433. ogonek            EQU         $FE                       ; ˛
  434. hachek            EQU         $FF                       ; (don't type it here - breaks MPW tools!)
  435.  
  436. ; -----------------------------------------------------------------------------
  437. ; Other new constants for 7.0                                                                <2.7>
  438. ; -----------------------------------------------------------------------------
  439.  
  440. ; Constants for truncWhere argument in TruncString and TruncText                            <2.7>
  441.  
  442. smTruncEnd        EQU         0                         ; Truncate at end
  443. smTruncMiddle     EQU         $4000                     ; Truncate in middle
  444.  
  445. ; Constants for TruncString and TruncText results                                            <13>
  446.  
  447. smNotTruncated     EQU         0                        ; No truncation was necessary
  448. smTruncated        EQU         1                         ; Truncation performed
  449. smTruncErr        EQU            -1                        ; General error
  450.  
  451. ; Constants for styleRunPosition argument in NPortionText, NDrawJust, NMeasureJust,            <2>
  452. ; NChar2Pixel, and NPixel2Char.
  453.  
  454. smOnlyStyleRun    EQU         0                         ; This is the only style run on the line.
  455. smLeftStyleRun    EQU         1                         ; This is leftmost of multiple style runs on the line.
  456. smRightStyleRun   EQU         2                         ; This is rightmost of multiple style runs on the line.
  457. smMiddleStyleRun  EQU         3                         ; There are multiple style runs on the line and this…
  458.                                                     ; …is neither the leftmost nor the rightmost.
  459.  
  460. ; -----------------------------------------------------------------------------
  461. ; Record declarations for itlc, itlb, itl2, itl4
  462. ; -----------------------------------------------------------------------------
  463. ; Record declaration for international configuration resource (type itlc).
  464.  
  465. ItlcRecord        record      0
  466. itlcSystem        ds.w        1                         ; default system script.
  467. itlcReserved      ds.w        1                         ; reserved
  468. itlcFontForce     ds.b        1                         ; default font force flag.
  469. itlcIntlForce     ds.b        1                         ; default intl force flag.
  470. itlcOldKybd       ds.b        1                         ; MacPlus intl keybd flag                <33>
  471. itlcFlags         ds.b        1                         ; general flags
  472. itlcIconOffset    ds.w        1                        ; keyboard icon offset (not in 7.0)        <1.3><33>
  473. itlcIconSide    ds.b        1                        ; keybd icon side (R=0,L=$FF) (not 7.0) <1.3><33>
  474. itlcIconRsvd    ds.b        1                        ; rsvd for other icon info                <1.3><33>
  475. itlcRegionCode    ds.w        1                        ; preferred verXxx code                    <4>
  476. itlcReserved3    ds.b        34                        ; for future use                        <4><5>
  477. itlcSize          equ         *                         ; size of script itlc.
  478.                   endr
  479.  
  480. ; Record declaration for international bundle resource (type itlb).
  481.  
  482. ItlbRecord        record      0
  483. itlbNumber        ds.w        1                         ; itl0 ID number.
  484. itlbDate          ds.w        1                         ; itl1 ID number.
  485. itlbSort          ds.w        1                         ; itl2 ID number.
  486. itlbFlags         ds.w        1                         ; Script Flags.
  487. itlbToken         ds.w        1                         ; itl4 ID number.
  488. itlbEncoding     ds.w        1                         ; itl5 ID # (optional; char encoding).    <22>
  489. itlbLang          ds.w        1                         ; current language for script
  490. itlbNumRep        ds.b        1                         ; number representation code
  491. itlbDateRep       ds.b        1                         ; date representation code
  492. itlbKeys          ds.w        1                         ; KCHR id number.
  493. itlbIcon          ds.w        1                         ; ID # of SICN or kcs#/kcs4/kcs8 suite.
  494. itlbSize          equ         *                         ; size of bundle.
  495.                   endr
  496.  
  497. ; Extended itlb to support auto initialization of scripts <8>
  498. ItlbExtRecord    record    0
  499. base            ds        ItlbRecord        ; un-extended itlbRecord
  500. itlbLocalSize    ds.l    1                ; size of script's local record
  501. itlbMonoFond    ds.w    1                ; default monospace FOND ID
  502. itlbMonoSize    ds.w    1                ; default monospace font size
  503. itlbPrefFond    ds.w    1                ; preferred FOND ID
  504. itlbPrefSize    ds.w    1                ; preferred font size
  505. itlbSmallFond    ds.w    1                ; default small FOND ID
  506. itlbSmallSize    ds.w    1                ; default small font size
  507. itlbSysFond        ds.w    1                ; default system FOND ID
  508. itlbSysSize        ds.w    1                ; default system font size
  509. itlbAppFond        ds.w    1                ; default application FOND ID
  510. itlbAppSize        ds.w    1                ; default application font size
  511. itlbHelpFond    ds.w    1                ; default Help Mgr FOND ID                            <9>
  512. itlbHelpSize    ds.w    1                ; default Help Mgr font size                        <9>
  513. itlbValidStyles    ds.b    1                ; mask of valid styles for script                    <18>
  514. itlbAliasStyle    ds.b    1                ; style (set) to mark aliases                        <18>
  515. itlbExtSize        equ    *                    ; size of ItlbExtRecord
  516.                 endr
  517.                 
  518. ; itl2 routine vector offsets.
  519.  
  520. initHook          EQU         0
  521. fetchHook         EQU         2
  522. vernierHook       EQU         4
  523. projectHook       EQU         6
  524. rsvdHook          EQU         8
  525. exitHook          EQU         10
  526.  
  527. ; Note that the value of itl2FlagsOffset is equal
  528. ; to the value of rsvdHook. In the old itl2
  529. ; format the value at this location was an 
  530. ; unused routine offset. In the new itl2
  531. ; format, the value at this location is a flag
  532. ; ($ffff) indicating the new format that includes
  533. ; the offsets to the tables for LwrString and
  534. ; tables for the Roman versions of the CharType,
  535. ; Transliterate and FindWord.
  536.  
  537. itl2FlagsOffset   EQU         8
  538. ; itl2 table offsets
  539.  
  540. typeListOffset      EQU         12
  541. classArrayOffset  EQU         14
  542. upperListOffset   EQU         16
  543. lowerListOffset   EQU         18
  544. upperNoMarkListOffset EQU     20
  545. wordTableOffset   EQU         22
  546. wrapTableOffset   EQU         24
  547. noMarkListOffset  EQU         26
  548. itl2VersionOffset EQU         28
  549. itl2FormatOffset  EQU        30        ;                                    <28>
  550.  
  551. ; New for System 7.0:<2.5>
  552. ; itl2 table/code lengths.
  553.  
  554. wordTableLen            EQU    54        ;                                    <2.5>
  555. wrapTableLen            EQU    56        ;                                    <2.5>
  556. findScriptTableOffset    EQU    60        ;                                     <8>
  557. findScriptTableLen        EQU    62        ;                                     <8>
  558.  
  559. ; New for System 7.0:
  560. ; itl2FormatOffset definitions
  561. hdrExtensionsExist    EQU        1        ;                                    <28>
  562.  
  563. ; String data structure for itl2 stack frames.
  564.  
  565. IUStrData         record      0
  566. curChar           ds.w        1                         ; current character.
  567. mapChar           ds.w        1                         ; projected character.
  568. decChar           ds.w        1                         ; decision char for weak equality.
  569. bufChar           ds.b        1                         ; buffer for expansion.
  570. justAfter         ds.b        1                         ; boolean for AE vs ligature-AE.
  571. ignChar           ds.b        1                         ; flag: ignore char.
  572. noFetch           ds.b        1                         ; flag: no fetch of next.
  573. strCnt            ds.w        1                         ; length word.
  574. strPtr            ds.l        1                         ; current ptr to string.
  575.                   endr
  576.  
  577. ; Stack frame for itl2 sorting routines.
  578.  
  579. IUSortFrame       record      {oldA6},decrement
  580. result            ds.w        1
  581. aStrText          ds.l        1
  582. bStrText          ds.l        1
  583. aStrLen           ds.w        1
  584. bStrLen           ds.w        1
  585. return            ds.l        1
  586. oldA6             ds.l        1
  587. aInfo             ds          IUStrData
  588. bInfo             ds          IUStrData
  589. wantMag         ds.b        1                        ; 0 to use primary differences only; else 1        <33>
  590. weakEq            ds.b        1                        ; Signals at most weak equality.
  591. msLock            ds.b        1                        ; (obsolete, not used)
  592. weakMag         ds.b        1                        ; -1 to force magnitude result (-1,0,1); else 0    <33>
  593. supStorage        ds.b        18                        ; extra storage.
  594. weakAPtr          ds.l        1                         ; sup. pointer
  595. weakBPtr          ds.l        1                         ; sup. pointer
  596. lkSize            equ         *                         ; frame size.
  597. paramBytes        equ         aStrText-return
  598.                   endr
  599.  
  600. ; New for System 7.0:
  601. ; New stack frame for itl2 sorting routines in System 7.0; adds itl2Handle field.                    <5>
  602.  
  603. IUNSortFrame record    {oldA6},decrement
  604. result        ds.w    1
  605. aStrText    ds.l    1
  606. bStrText    ds.l    1
  607. aStrLen        ds.w    1
  608. bStrLen        ds.w    1
  609. return        ds.l    1
  610. oldA6        ds.l    1
  611. aInfo        ds    IUStrData
  612. bInfo        ds    IUStrData
  613. wantMag     ds.b    1            ; 0 to use primary differences only; else 1                            <33>
  614. weakEq        ds.b    1            ; Signals at most weak equality.
  615. msLock        ds.b    1            ; (obsolete, not used)
  616. weakMag     ds.b    1            ; -1 to force magnitude result (-1,0,1); else 0                        <33>
  617. supStorage    ds.b    18            ; extra storage.
  618. weakAPtr    ds.l    1            ; sup. pointer
  619. weakBPtr    ds.l    1            ; sup. pointer
  620. itl2Handle    ds.l    1            ; itl2 handle, if supplied                                            <2.3>
  621. lkSize        equ    *                ; frame size.
  622. paramBytes    equ    aStrText-return
  623.             endr
  624.  
  625. Itl4Rec           record      0,increment    ;                                                (added comments <33>)
  626. flags             ds.w        1            ; reserved
  627. resourceType      ds.l        1            ; contains 'itl4'
  628. resourceNum       ds.w        1            ; resource ID
  629. version           ds.w        1            ; version number
  630. resHeader1        ds.l        1            ; reserved
  631. resHeader2        ds.l        1            ; reserved
  632. numTables         ds.w        1            ; number of tables, one-based
  633.                                 ; the following offsets are from beginning of resource
  634. mapOffset         ds.l        1            ; offset to table that maps byte to token
  635. strOffset         ds.l        1            ; offset to routine that copies canonical string
  636. fetchOffset       ds.l        1            ; offset to routine that gets next byte of character
  637. unTokenOffset     ds.l        1            ; offset to table that maps token to canonical string
  638. defPartsOffset    ds.l        1            ; offset to default number parts table
  639. resOffset6        ds.l        1            ; reserved
  640. resOffset7        ds.l        1            ; reserved
  641. resOffset8        ds.l        1            ; reserved
  642. itl4HeaderSize    equ         *
  643. ; the rest is data pointed to by offsets.
  644.                   endr
  645.  
  646. ; New for System 7.0:    <5>
  647.  
  648. NItl4Rec        record    0,increment    ;                                        (added comments <33>)
  649. flags            ds.w    1            ; reserved
  650. resourceType    ds.l    1            ; contains 'itl4'
  651. resourceNum        ds.w    1            ; resource ID
  652. version            ds.w    1            ; version number
  653. format            ds.w    1            ; format code                                <29>
  654. resHeader        ds.w    1            ; reserved                                    <29>
  655. resHeader2        ds.l    1            ; reserved
  656. numTables        ds.w    1            ; number of tables, one-based
  657.                             ; the following offsets are from beginning of resource
  658. mapOffset        ds.l    1            ; offset to table that maps byte to token
  659. strOffset        ds.l    1            ; offset to routine that copies canonical string
  660. fetchOffset        ds.l    1            ; offset to routine that gets next byte of character
  661. unTokenOffset    ds.l    1            ; offset to table that maps token to canonical string
  662. defPartsOffset    ds.l    1            ; offset to default number parts table
  663. whtSpListOffset    ds.l    1            ; offset to white space code list            <2.3><15>
  664. resOffset7        ds.l    1            ; reserved
  665. resOffset8        ds.l    1            ; reserved
  666. resLength1        ds.w    1            ; reserved                                    <2.5>
  667. resLength2        ds.w    1            ; reserved                                    <2.5>
  668. resLength3        ds.w    1            ; reserved                                    <2.5>
  669. unTokenLength    ds.w    1            ; length of untoken table                    <2.5><9>
  670. defPartsLength    ds.w    1            ; length of default number parts table        <2.5><9>
  671. whtSpListLength    ds.w    1            ; length of white space code list            <2.5><9><20>
  672. resLength7        ds.w    1            ; reserved                                    <2.5>
  673. resLength8        ds.w    1            ; reserved                                    <2.5>
  674. nItl4HeaderSize    equ        *            ;                                            <22>
  675. ; the rest is data pointed to by offsets.
  676.             endr
  677.  
  678. ; -----------------------------------------------------------------------------
  679. ; Record declarations and constants for date/time/location handling
  680. ; -----------------------------------------------------------------------------
  681.  
  682. LongDateRec       record      0                         ; zero any fields not used!
  683. era               ds.w        1
  684. year              ds.w        1
  685. month             ds.w        1
  686. day               ds.w        1
  687. hour              ds.w        1
  688. minute            ds.w        1
  689. second            ds.w        1
  690. dayOfWeek         ds.w        1
  691. dayOfYear         ds.w        1
  692. weekOfYear        ds.w        1
  693. pm                ds.w        1
  694. ldReserved        ds.w        3
  695. LongDateRecSize   equ         *
  696.                   endR
  697.  
  698. LongDateTime      record      0                         ; record for comp type
  699. highLong          ds.l        1
  700. lowLong           ds.l        1
  701.                   endR
  702.  
  703. ; date equates constants
  704.  
  705. LongDateField     record      0                         ;DateField: enum type
  706. eraField          ds.b        1
  707. yearField         ds.b        1
  708. monthField        ds.b        1
  709. dayField          ds.b        1
  710. hourField         ds.b        1
  711. minuteField       ds.b        1
  712. secondField       ds.b        1
  713. dayOfWeekField    ds.b        1
  714. dayOfYearField    ds.b        1
  715. weekOfYearField   ds.b        1
  716. pmField           ds.b        1
  717. res1Field         ds.b        1
  718. res2Field         ds.b        1
  719. res3Field         ds.b        1
  720.  
  721. maxDateField      equ         pmField                   ; currently largest used field
  722.  
  723. eraMask           equ         1<<eraField
  724. yearMask          equ         1<<yearField
  725. monthMask         equ         1<<monthField
  726. dayMask           equ         1<<dayField
  727. hourMask          equ         1<<hourField
  728. minuteMask        equ         1<<minuteField
  729. secondMask        equ         1<<secondField
  730. dayOfWeekMask     equ         1<<dayOfWeekField
  731. dayOfYearMask     equ         1<<dayOfYearField
  732. weekOfYearMask    equ         1<<weekOfYearField
  733. pmMask            equ         1<<pmField
  734.  
  735. dateStdMask       equ         eraMask++yearMask++monthMask++dayMask++hourMask++minuteMask++secondMask
  736.                   endR
  737.  
  738. smallDateBit      EQU         31                        ; Restrict valid date/time to range of Time global
  739. togChar12HourBit  EQU         30                        ; If toggling hour by char, accept hours 1..12 only
  740. togCharZCycleBit  EQU         29                        ; Modifier for togChar12HourBit: accept hours 0..11 only
  741. togDelta12HourBit EQU         28                        ; If toggling hour up/down, restrict to 12-hour range (am/pm)
  742. genCdevRangeBit   EQU         27                        ; Restrict date/time to range used by genl CDEV
  743. validDateFields   EQU         -1
  744.  
  745.  
  746. TogglePB          record      0
  747. togFlags:         ds.l        1                         ; longint; caller normally sets low word to dateStdMask = $7F
  748. amChars:          ds.l        1                         ; ResType; from 'itl0', but uppercased                <33>
  749. pmChars:          ds.l        1                         ; ResType; from 'itl0', but uppercased                <33>
  750. reserved:         ds.l        4                         ; array [0..3] of Longint
  751.                   endR
  752.  
  753. ToggleResults     record      0
  754. toggleUndefined   ds.b        1
  755. toggleOk          ds.b        1
  756. toggleBadField    ds.b        1
  757. toggleBadDelta    ds.b        1
  758. toggleBadChar     ds.b        1
  759. toggleUnknown     ds.b        1
  760. toggleBadNum      ds.b        1                         ; can't use char as number
  761. toggleOutOfRange  EQU         *                         ; synonym for toggleErr3
  762. toggleErr3        ds.b        1                         ; reserved
  763. toggleErr4        ds.b        1                         ; reserved
  764. toggleErr5        ds.b        1                         ; reserved
  765.                   endR
  766.  
  767. MachineLocation   record      0
  768. latitude          ds.l        1                         ; fract
  769. longitude         ds.l        1                         ; fract
  770. dlsDelta          ds.b        1                         ; signed byte
  771. gmtDelta          ds.b        3                         ; 3 byte signed integer
  772.                   endR
  773.  
  774.  
  775. ; String2Date/String2Time status values
  776.  
  777. fatalDateTime        EQU     $8000                     ; String2Date and String2Time mask to a fatal error
  778. longDateFound        EQU     1                         ; String2Date mask to long date found
  779. leftOverChars        EQU     2                         ; String2Date & Time mask to warn of left over characters
  780. sepNotIntlSep        EQU     4                         ; String2Date & Time mask to warn of non-standard separators
  781. fieldOrderNotIntl    EQU     8                         ; String2Date & Time mask to warn of non-standard field order
  782. extraneousStrings    EQU     16                        ; String2Date & Time mask to warn of unparsable strings in text
  783. tooManySeps            EQU     32                        ; String2Date & Time mask to warn of too many separators
  784. sepNotConsistent    EQU     64                        ; String2Date & Time mask to warn of inconsistent separators
  785. tokenErr            EQU     fatalDateTime + 256       ; String2Date & Time mask for 'tokenizer err encountered'
  786. cantReadUtilities    EQU     fatalDateTime + 512       ;
  787. dateTimeNotFound    EQU     fatalDateTime + 1024      ; String2Date mask for 'date was not found'
  788. dateTimeInvalid        EQU     fatalDateTime + 2048      ; Invalid time/date e.g. 13:61PM
  789.  
  790.  
  791. DateOrders        RECORD      0,INCREMENT
  792. mdy               DS.B        1
  793. dmy               DS.B        1
  794. ymd               DS.B        1
  795. myd               DS.B        1
  796. dym               DS.B        1
  797. ydm               DS.B        1
  798.                   ENDR
  799.  
  800. ; -----------------------------------------------------------------------------
  801. ;  Constants and record declarations for tokenizer                            (added comments <33>)
  802. ; -----------------------------------------------------------------------------
  803.  
  804. tokenIntl         EQU         4             ; the itl resource number for the tokenizer
  805.  
  806. tokenEmpty        EQU         -1            ; used internally as an empty flag
  807. tokenUnknown      EQU         0            ; chars that do not match a defined token type
  808. tokenWhite        EQU         1            ; white space
  809. tokenLeftLit      EQU         2            ; literal begin
  810. tokenRightLit     EQU         3            ; literal end
  811. tokenAlpha        EQU         4            ; alphabetic
  812. tokenNumeric      EQU         5            ; numeric
  813. tokenNewLine      EQU         6            ; new line
  814. tokenLeftComment  EQU         7            ; open comment
  815. tokenRightComment EQU         8            ; close comment
  816. tokenLiteral      EQU         9            ; literal
  817. tokenEscape       EQU         10            ; character escape (e.g. '\' in "\n", "\t")
  818. tokenAltNum       EQU         11            ; alternate number (e.g. $B0-B9 in Arabic,Hebrew)
  819. tokenRealNum      EQU         12            ; real number
  820. tokenAltReal      EQU         13            ; alternate real number
  821. tokenReserve1     EQU         14            ; reserved
  822. tokenReserve2     EQU         15            ; reserved
  823. tokenLeftParen    EQU         16            ; open parenthesis
  824. tokenRightParen   EQU         17            ; close parenthesis
  825. tokenLeftBracket  EQU         18            ; open square bracket
  826. tokenRightBracket EQU         19            ; close square bracket
  827. tokenLeftCurly    EQU         20            ; open curly bracket
  828. tokenRightCurly   EQU         21            ; close curly bracket
  829. tokenLeftEnclose  EQU         22            ; open guillemet
  830. tokenRightEnclose EQU         23            ; close guillemet
  831. tokenPlus         EQU         24
  832. tokenMinus        EQU         25
  833. tokenAsterisk     EQU         26            ; times/multiply
  834. tokenDivide       EQU         27
  835. tokenPlusMinus    EQU         28            ; plus or minus symbol
  836. tokenSlash        EQU         29
  837. tokenBackSlash    EQU         30
  838. tokenLess         EQU         31            ; less than symbol
  839. tokenGreat        EQU         32            ; greater than symbol
  840. tokenEqual        EQU         33
  841. tokenLessEqual2   EQU         34            ; less than or equal, 2 characters (e.g. <=)
  842. tokenLessEqual1   EQU         35            ; less than or equal, 1 character
  843. tokenGreatEqual2  EQU         36            ; greater than or equal, 2 characters (e.g. >=)
  844. tokenGreatEqual1  EQU         37            ; greater than or equal, 1 character
  845. token2Equal       EQU         38            ; double equal (e.g. ==)
  846. tokenColonEqual   EQU         39            ; colon equal
  847. tokenNotEqual     EQU         40            ; not equal, 1 character
  848. tokenLessGreat    EQU         41            ; less/greater, Pascal not equal (e.g. <>)
  849. tokenExclamEqual  EQU         42            ; exclamation equal, C not equal (e.g. !=)
  850. tokenExclam       EQU         43            ; exclamation point
  851. tokenTilde        EQU         44            ; centered tilde                        (fix spelling <15>)
  852. tokenComma        EQU         45
  853. tokenPeriod       EQU         46
  854. tokenLeft2Quote   EQU         47            ; open double quote
  855. tokenRight2Quote  EQU         48            ; close double quote
  856. tokenLeft1Quote   EQU         49            ; open single quote
  857. tokenRight1Quote  EQU         50            ; close single quote
  858. token2Quote       EQU         51            ; double quote
  859. token1Quote       EQU         52            ; single quote
  860. tokenSemicolon    EQU         53
  861. tokenPercent      EQU         54
  862. tokenCaret        EQU         55            ;                                        (fix spelling <33>)
  863. tokenUnderline    EQU         56
  864. tokenAmpersand    EQU         57
  865. tokenAtSign       EQU         58
  866. tokenBar          EQU         59            ; vertical bar
  867. tokenQuestion     EQU         60
  868. tokenPi           EQU         61            ; lower-case pi
  869. tokenRoot         EQU         62            ; square root symbol
  870. tokenSigma        EQU         63            ; capital sigma
  871. tokenIntegral     EQU         64            ; integral sign
  872. tokenMicro        EQU         65
  873. tokenCapPi        EQU         66            ; capital pi
  874. tokenInfinity     EQU         67
  875. tokenColon        EQU         68
  876. tokenHash         EQU         69            ; e.g. #
  877. tokenDollar       EQU         70
  878. tokenNoBreakSpace EQU         71            ; non-breaking space
  879. tokenFraction     EQU         72
  880. tokenIntlCurrency EQU         73
  881. tokenLeftSingGuillemet EQU    74
  882. tokenRightSingGuillemet EQU   75        ;                                    (Fixed spelling <19>)
  883. tokenPerThousand  EQU         76
  884. tokenEllipsis    EQU         77            ;                                            <15>
  885. tokenCenterDot    EQU         78            ;                                            <15>
  886. tokenNil          EQU         127
  887.  
  888. delimPad          EQU         -2
  889.  
  890. ; obsolete, misspelled token names kept for backward compatibility            (moved here <33>)
  891.  
  892. tokenTilda        EQU         44            ; keep wrong spelling for backward compatibility <15>
  893. tokenCarat        EQU         55
  894.  
  895. TokenResults      record      0
  896. tokenOK           ds.b        1
  897. tokenOverflow     ds.b        1
  898. stringOverflow    ds.b        1
  899. badDelim          ds.b        1
  900. badEnding         ds.b        1
  901. crash             ds.b        1
  902.                   endr
  903.  
  904. TokenBlock        RECORD      0,INCR                    ;                                    (added comments <33>)
  905. source            ds.l        1                        ; pointer to stream of characters
  906. sourceLength      ds.l        1                        ; length of source stream
  907. tokenList         ds.l        1                        ; pointer to array of tokens
  908. tokenLength       ds.l        1                        ; maximum length of TokenList
  909. tokenCount        ds.l        1                        ; number tokens generated by tokenizer
  910. stringList        ds.l        1                        ; pointer to stream of identifiers
  911. stringLength      ds.l        1                        ; length of string list
  912. stringCount       ds.l        1                        ; number of bytes currently used
  913. doString          ds.b        1                        ; Boolean: make strings & put into StringList
  914. doAppend          ds.b        1                        ; Boolean: append to TokenList rather than replace
  915. doAlphanumeric    ds.b        1                        ; Boolean: identifiers may include numeric
  916. doNest            ds.b        1                        ; Boolean: do comments nest?
  917. leftDelims        ds.w        2
  918. rightDelims       ds.w        2
  919. leftComment       ds.l        2
  920. rightComment      ds.l        2
  921. escapeCode        ds.w        1                        ; escape symbol code
  922. decimalCode       ds.w        1
  923. itlResource       ds.l        1                        ; handle to itl4 resource of current script
  924. reserved          ds.l        8                         ; must be zero!
  925.                   ENDR
  926.  
  927. TokenRec          RECORD      0,INCR                    ;                                    (added comments <33>)
  928. theToken          ds.w        1                        ; TokenType
  929. position          ds.l        1                        ; Ptr into original source
  930. length            ds.l        1                        ; length of text in original source
  931. stringPosition    ds.l        1                        ; StringPtr to copy of identifier
  932. tokenRecSize      equ         *
  933.                   ENDR
  934.  
  935. UntokenTable      Record      0, INCR
  936. len               ds.w        1
  937. lastToken         ds.w        1
  938. index             ds.w        256                       ; index table; last = lastToken
  939. ;list of pascal strings here. index pointers are from front of table
  940.                   Endr
  941.  
  942. ; -----------------------------------------------------------------------------
  943. ; Record declarations and constants for formatted number handling
  944. ; -----------------------------------------------------------------------------
  945.  
  946. ; FormatClass enumeration
  947.  
  948. fPositive         EQU         0
  949. fNegative         EQU         1
  950. fZero             EQU         2
  951.  
  952. ; FormatResultType enumeration
  953.  
  954. fFormatOK         EQU         0
  955. fBestGuess        EQU         1
  956. fOutOfSynch       EQU         2
  957. fSpuriousChars    EQU         3
  958. fMissingDelimiter EQU         4
  959. fExtraDecimal     EQU         5
  960. fMissingLiteral   EQU         6
  961. fExtraExp         EQU         7
  962. fFormatOverflow   EQU         8
  963. fFormStrIsNAN     EQU         9
  964. fBadPartsTable    EQU         10
  965. fExtraPercent     EQU         11
  966. fExtraSeparator   EQU         12
  967. fEmptyFormatString EQU        13
  968.  
  969. WideChar          record      0,increment
  970. a                 ds.b        2                         ; PACKED ARRAY[0..1] OF CHAR
  971.                   ORG         a
  972. b                 ds.w        1                         ; INTEGER
  973.                   endr
  974.  
  975. WideCharArr       record      0,increment
  976. size              ds.w        1                         ; INTEGER
  977. data              ds.w        10                        ; PACKED ARRAY[0..9] OF WideChar
  978.                   endr
  979.  
  980. fVNumber          EQU         0                         ; first version of NumFormatString
  981.  
  982. NumFormatString   record      0,increment
  983. fLength           ds.b        1                         ; length of format String
  984. fVersion          ds.b        1                         ; version number
  985. data            ds.b        254                        ; private data                                <33>
  986.                   endr
  987.  
  988. ;Number format equates
  989.  
  990. tokLeftQuote      EQU         1
  991. tokRightQuote     EQU         2
  992. tokLeadPlacer     EQU         3
  993. tokLeader         EQU         4
  994. tokNonLeader      EQU         5
  995. tokZeroLead       EQU         6
  996. tokPercent        EQU         7
  997. tokPlusSign       EQU         8
  998. tokMinusSign      EQU         9
  999. tokThousands      EQU         10
  1000. tokSeparator      EQU         12                        ; 11 is reserved
  1001. tokEscape         EQU         13
  1002. tokDecPoint       EQU         14
  1003. tokEPlus          EQU         15
  1004. tokEMinus         EQU         16
  1005. tokMaxSymbols     EQU         31
  1006.  
  1007. NumberParts       record      0,increment
  1008. version           ds.w        1                         ; integer
  1009. data              ds.w        tokMaxSymbols             ; ARRAY[tokLeftQuote..tokMaxSymbols] OF WideChar
  1010. pePlus            ds          WideCharArr               ; 64
  1011. peMinus           ds          WideCharArr               ; 86
  1012. peMinusPlus       ds          WideCharArr               ; 108
  1013. altNumTable       ds          WideCharArr               ; 130
  1014. reserved          ds.b        20
  1015. numberPartsSize   equ         *
  1016. curNumberPartsVersion equ     1
  1017.                   endr
  1018.  
  1019.  
  1020. FVector           record      0,increment
  1021. start             ds.w        1                         ; INTEGER
  1022. length            ds.w        1                         ; INTEGER
  1023.                   endr
  1024.  
  1025. TripleInt         record      0,increment
  1026. zzz1              ds          FVector
  1027. zzz2              ds          FVector
  1028. zzz3              ds          FVector
  1029.                   endr
  1030.  
  1031. ; -----------------------------------------------------------------------------
  1032. ; Record for FindScriptRun result
  1033. ; -----------------------------------------------------------------------------
  1034.  
  1035. ScriptRunStatus   record      0,increment
  1036. script            ds.b        1
  1037. variant           ds.b        1
  1038.                   endr
  1039.  
  1040. ; -----------------------------------------------------------------------------
  1041. ; Selectors and macros for the Script Manager trap call, _ScriptUtil
  1042. ; -----------------------------------------------------------------------------
  1043.  
  1044.                   Macro
  1045.                   DefSMgrRoutine &name,&selector,&argSize,&returnSize
  1046.                   sm&name:    equ &selector**$FFFF
  1047.                   smSel&name: equ (1<<31)++(&returnSize<<24)++(&argSize<<16)++sm&name
  1048.                   endm
  1049.  
  1050. ; Trap routine selectors: script manager 1.0
  1051.  
  1052. smFontScript      EQU         0
  1053. smIntlScript      EQU         2
  1054. smKybdScript      EQU         4
  1055. smFont2Script     EQU         6
  1056. smGetEnvirons     EQU         8
  1057. smSetEnvirons     EQU         10
  1058. smGetScript       EQU         12
  1059. smSetScript       EQU         14
  1060. smHighCall        EQU         smSetScript               ; boundary between script mgr & script systems
  1061. smCharByte        EQU         16
  1062. smCharType        EQU         18
  1063. smPixel2Char      EQU         20
  1064. smChar2Pixel      EQU         22
  1065. smTranslit        EQU         24
  1066. smFindWord        EQU         26
  1067. smHiliteText      EQU         28
  1068. smDrawJust        EQU         30
  1069. smMeasureJust     EQU         32
  1070. smParseTable      EQU         34
  1071.  
  1072. ; Full Trap routine selectors: script manager 1.0
  1073.  
  1074. ; format                     newBit  return/args
  1075. smSelFontScript        EQU     (1<<31)++($0200<<16)++smFontScript
  1076. smSelIntlScript        EQU     (1<<31)++($0200<<16)++smIntlScript
  1077. smSelKybdScript        EQU     (1<<31)++($0002<<16)++smKybdScript
  1078. smSelFont2Script    EQU     (1<<31)++($0202<<16)++smFont2Script
  1079. smSelGetEnvirons    EQU     (1<<31)++($0402<<16)++smGetEnvirons
  1080. smSelSetEnvirons    EQU     (1<<31)++($0206<<16)++smSetEnvirons
  1081. smSelGetScript        EQU     (1<<31)++($0404<<16)++smGetScript
  1082. smSelSetScript        EQU     (1<<31)++($0208<<16)++smSetScript
  1083. smSelCharType        EQU     (1<<31)++($0206<<16)++smCharType
  1084. smSelCharByte        EQU     (1<<31)++($0206<<16)++smCharByte
  1085. smSelPixel2Char        EQU     (1<<31)++($020E<<16)++smPixel2Char
  1086. smSelChar2Pixel        EQU     (1<<31)++($020C<<16)++smChar2Pixel
  1087. smSelTranslit        EQU     (1<<31)++($020E<<16)++smTranslit
  1088. smSelFindWord        EQU     (1<<31)++($0012<<16)++smFindWord
  1089. smSelHiliteText        EQU     (1<<31)++($000E<<16)++smHiliteText
  1090. smSelDrawJust        EQU     (1<<31)++($0008<<16)++smDrawJust
  1091. smSelMeasureJust    EQU     (1<<31)++($000C<<16)++smMeasureJust
  1092. smSelParseTable        EQU     (1<<31)++($0204<<16)++smParseTable
  1093.  
  1094. ; selectors for general script manager 2.0 routines
  1095.  
  1096.         DefSmgrRoutine StyledLineBreak, -2,28,2
  1097.         DefSmgrRoutine GetFormatOrder, -4,18,0
  1098.         DefSmgrRoutine IntlTokenize, -6,4,2
  1099.  
  1100.         DefSmgrRoutine InitDateCache, -8,4,2
  1101.         DefSmgrRoutine String2Date, -10,20,2
  1102.         DefSmgrRoutine String2Time, -12,20,2
  1103.  
  1104.         DefSmgrRoutine LongDate2Secs, -14,8,0
  1105.         DefSmgrRoutine LongSecs2Date, -16,8,0
  1106.         DefSmgrRoutine ToggleDate, -18,14,2
  1107.  
  1108.         DefSmgrRoutine Str2Format, -20,12,2
  1109.         DefSmgrRoutine Format2Str, -22,16,2
  1110.         DefSmgrRoutine FormatX2Str, -24,16,2
  1111.         DefSmgrRoutine FormatStr2X, -26,16,2
  1112.         DefSmgrRoutine ValidDate, -28,12,2
  1113.  
  1114. ; selectors for script-specific script manager 2.0 routines
  1115.  
  1116.         DefSmgrRoutine PortionText, 36,8,4
  1117.         DefSmgrRoutine FindScriptRun, 38,12,2
  1118.         DefSmgrRoutine VisibleLength, 40,8,4
  1119.         DefSmgrRoutine IsSpecialFont, 42,2,2
  1120.         DefSmgrRoutine RawPrinterValues, 44,22,2
  1121.  
  1122. ; selectors for general script manager 7.0 routines                                    <2.1><2.4>
  1123.  
  1124.         DefSmgrRoutine    NFindWord, -30,18,0            ; smSel… = $8012FFE2            <2.3>
  1125.         DefSmgrRoutine    TruncString, -32,8,2        ; smSel… = $8208FFE0            <2.3><2.7><6>
  1126.         DefSmgrRoutine    TruncText, -34,12,2            ; smSel… = $820CFFDE            <2.3><2.7><6>
  1127.         DefSmgrRoutine    ReplaceText, -36,12,2        ; smSel… = $820CFFDC            <2.3>
  1128.  
  1129. ; selectors for script-specific script manager 7.0 routines                                <2>
  1130.  
  1131.         DefSmgrRoutine    NPixel2Char,    46,34,2        ;     $8222002E                        <2><17>
  1132.         DefSmgrRoutine    NChar2Pixel,    48,28,2        ;     $821C0030                        <2><17>
  1133.         DefSmgrRoutine    NDrawJust,        50,22,0        ;     $80160032                        <2><17>
  1134.         DefSmgrRoutine    NMeasureJust,    52,26,0        ;     $801A0034                        <2><17>
  1135.         DefSmgrRoutine    NPortionText,    54,18,4        ;     $84120036                        <2><17>
  1136.         
  1137. ; moved definition of sisHighCall and fisHighCall to ScriptPriv.a                         <2>
  1138.  
  1139. ;------------------------------------------------------------------------------
  1140. ; Trap routine macros: Script Manager 1.0
  1141.  
  1142.                   macro
  1143.                   _FontScript
  1144.                   move.l      #smSelFontScript,-(sp)
  1145.                   _ScriptUtil
  1146.                   endm
  1147.  
  1148.                   macro
  1149.                   _IntlScript
  1150.                   move.l      #smSelIntlScript,-(sp)
  1151.                   _ScriptUtil
  1152.                   endm
  1153.  
  1154.                   macro
  1155.                   _KeyScript
  1156.                   move.l      #smSelKybdScript,-(sp)
  1157.                   _ScriptUtil
  1158.                   endm
  1159.  
  1160.                   macro
  1161.                   _Font2Script
  1162.                   move.l      #smSelFont2Script,-(sp)
  1163.                   _ScriptUtil
  1164.                   endm
  1165.  
  1166.                   macro
  1167.                   _GetEnvirons
  1168.                   move.l      #smSelGetEnvirons,-(sp)
  1169.                   _ScriptUtil
  1170.                   endm
  1171.  
  1172.                   macro
  1173.                   _SetEnvirons
  1174.                   move.l      #smSelSetEnvirons,-(sp)
  1175.                   _ScriptUtil
  1176.                   endm
  1177.  
  1178.                   macro
  1179.                   _GetScript
  1180.                   move.l      #smSelGetScript,-(sp)
  1181.                   _ScriptUtil
  1182.                   endm
  1183.  
  1184.                   macro
  1185.                   _SetScript
  1186.                   move.l      #smSelSetScript,-(sp)
  1187.                   _ScriptUtil
  1188.                   endm
  1189.  
  1190.                   macro
  1191.                   _CharByte
  1192.                   move.l      #smSelCharByte,-(sp)
  1193.                   _ScriptUtil
  1194.                   endm
  1195.  
  1196.                   macro
  1197.                   _CharType
  1198.                   move.l      #smSelCharType,-(sp)
  1199.                   _ScriptUtil
  1200.                   endm
  1201.  
  1202.                   macro
  1203.                   _Pixel2Char
  1204.                   move.l      #smSelPixel2Char,-(sp)
  1205.                   _ScriptUtil
  1206.                   endm
  1207.  
  1208.                   macro
  1209.                   _Char2Pixel
  1210.                   move.l      #smSelChar2Pixel,-(sp)
  1211.                   _ScriptUtil
  1212.                   endm
  1213.  
  1214.                   macro
  1215.                   _Transliterate
  1216.                   move.l      #smSelTranslit,-(sp)
  1217.                   _ScriptUtil
  1218.                   endm
  1219.  
  1220.                   macro
  1221.                   _FindWord
  1222.                   move.l      #smSelFindWord,-(sp)
  1223.                   _ScriptUtil
  1224.                   endm
  1225.  
  1226.                   macro
  1227.                   _HiliteText
  1228.                   move.l      #smSelHiliteText,-(sp)
  1229.                   _ScriptUtil
  1230.                   endm
  1231.  
  1232.                   macro
  1233.                   _DrawJust
  1234.                   move.l      #smSelDrawJust,-(sp)
  1235.                   _ScriptUtil
  1236.                   endm
  1237.  
  1238.                   macro
  1239.                   _MeasureJust
  1240.                   move.l      #smSelMeasureJust,-(sp)
  1241.                   _ScriptUtil
  1242.                   endm
  1243.  
  1244.                   macro
  1245.                   _ParseTable
  1246.                   move.l      #smSelParseTable,-(sp)
  1247.                   _ScriptUtil
  1248.                   endm
  1249.  
  1250. ;------------------------------------------------------------------------------
  1251. ; Trap routine macros: Script Manager 2.0
  1252.  
  1253.                   macro
  1254.                   _GetFormatOrder
  1255.                   move.l      #smSelGetFormatOrder,-(sp)
  1256.                   _ScriptUtil
  1257.                   endm
  1258.  
  1259.                   macro
  1260.                   _StyledLineBreak
  1261.                   move.l      #smSelStyledLineBreak,-(sp)
  1262.                   _ScriptUtil
  1263.                   endm
  1264.  
  1265.                   macro
  1266.                   _IntlTokenize
  1267.                   move.l      #smSelIntlTokenize,-(sp)
  1268.                   _ScriptUtil
  1269.                   endm
  1270.  
  1271.                   macro
  1272.                   _InitDateCache
  1273.                   move.l      #smSelInitDateCache,-(sp)
  1274.                   _ScriptUtil
  1275.                   endm
  1276.  
  1277.                   macro
  1278.                   _String2Date
  1279.                   move.l      #smSelString2Date,-(sp)
  1280.                   _ScriptUtil
  1281.                   endm
  1282.  
  1283.                   macro
  1284.                   _String2Time
  1285.                   move.l      #smSelString2Time,-(sp)
  1286.                   _ScriptUtil
  1287.                   endm
  1288.  
  1289.                   macro
  1290.                   _LongSecs2Date
  1291.                   move.l      #smSelLongSecs2Date,-(sp)
  1292.                   _ScriptUtil
  1293.                   endm
  1294.  
  1295.                   macro
  1296.                   _LongDate2Secs
  1297.                   move.l      #smSelLongDate2Secs,-(sp)
  1298.                   _ScriptUtil
  1299.                   endm
  1300.  
  1301.                   macro
  1302.                   _Str2Format
  1303.                   move.l      #smSelStr2Format,-(sp)
  1304.                   _ScriptUtil
  1305.                   endm
  1306.  
  1307.                   macro
  1308.                   _Format2Str
  1309.                   move.l      #smSelFormat2Str,-(sp)
  1310.                   _ScriptUtil
  1311.                   endm
  1312.  
  1313.                   macro
  1314.                   _FormatX2Str
  1315.                   move.l      #smSelFormatX2Str,-(sp)
  1316.                   _ScriptUtil
  1317.                   endm
  1318.  
  1319.                   macro
  1320.                   _FormatStr2X
  1321.                   move.l      #smSelFormatStr2X,-(sp)
  1322.                   _ScriptUtil
  1323.                   endm
  1324.  
  1325.                   macro
  1326.                   _ValidDate
  1327.                   move.l      #smSelValidDate,-(sp)
  1328.                   _ScriptUtil
  1329.                   endm
  1330.  
  1331.                   macro
  1332.                   _ToggleDate
  1333.                   move.l      #smSelToggleDate,-(sp)
  1334.                   _ScriptUtil
  1335.                   endm
  1336.  
  1337.                   macro
  1338.                   _PortionText
  1339.                   move.l      #smSelPortionText,-(sp)
  1340.                   _ScriptUtil
  1341.                   endm
  1342.  
  1343.                   macro
  1344.                   _FindScriptRun
  1345.                   move.l      #smSelFindScriptRun,-(sp)
  1346.                   _ScriptUtil
  1347.                   endm
  1348.  
  1349.                   macro
  1350.                   _ReadLocation
  1351.                   movea.l     (sp)+,A0
  1352.                   move.l      #$000C00E4,D0
  1353.                   _ReadXPRam
  1354.                   endm
  1355.  
  1356.                   macro
  1357.                   _WriteLocation
  1358.                   movea.l     (sp)+,A0
  1359.                   move.l      #$000C00E4,D0
  1360.                   _WriteXPRam
  1361.                   endm
  1362.  
  1363.                   macro
  1364.                   _VisibleLength
  1365.                   move.l      #smSelVisibleLength,-(sp)
  1366.                   _ScriptUtil
  1367.                   endm
  1368.  
  1369.                   macro
  1370.                   _IsSpecialFont
  1371.                   move.l      #smSelIsSpecialFont,-(sp)
  1372.                   _ScriptUtil
  1373.                   endm
  1374.  
  1375.                   macro
  1376.                   _RawPrinterValues
  1377.                   move.l      #smSelRawPrinterValues,-(sp)
  1378.                   _ScriptUtil
  1379.                   endm
  1380.  
  1381.  
  1382. ;------------------------------------------------------------------------------
  1383. ; Trap routine macros: Script Manager 7.0                    <2.1>
  1384.  
  1385.                 macro
  1386.                 _NFindWord                                    ; <2.3>
  1387.                 move.l      #smSelNFindWord,-(sp)
  1388.                 _ScriptUtil
  1389.                 endm
  1390.         
  1391.                 macro
  1392.                 _TruncString                                ; <2.3>
  1393.                 move.l      #smSelTruncString,-(sp)
  1394.                 _ScriptUtil
  1395.                 endm
  1396.         
  1397.                 macro
  1398.                 _TruncText                                    ; <2.3>
  1399.                 move.l      #smSelTruncText,-(sp)
  1400.                 _ScriptUtil
  1401.                 endm
  1402.         
  1403.                 macro
  1404.                 _ReplaceText                                ; <2.3>
  1405.                 move.l      #smSelReplaceText,-(sp)
  1406.                 _ScriptUtil
  1407.                 endm
  1408.         
  1409.                 macro
  1410.                 _NPixel2Char                                ;    <2>
  1411.                 move.l      #smSelNPixel2Char,-(sp)
  1412.                 _ScriptUtil
  1413.                 endm
  1414.         
  1415.                 macro
  1416.                 _NChar2Pixel                                ;    <2>
  1417.                 move.l      #smSelNChar2Pixel,-(sp)
  1418.                 _ScriptUtil
  1419.                 endm
  1420.         
  1421.                 macro
  1422.                 _NDrawJust                                    ;    <2>
  1423.                 move.l      #smSelNDrawJust,-(sp)
  1424.                 _ScriptUtil
  1425.                 endm
  1426.         
  1427.                 macro
  1428.                 _NMeasureJust                                ;    <2>
  1429.                 move.l      #smSelNMeasureJust,-(sp)
  1430.                 _ScriptUtil
  1431.                 endm
  1432.         
  1433.                 macro
  1434.                 _NPortionText                                ;    <2>
  1435.                   move.l      #smSelNPortionText,-(sp)
  1436.                   _ScriptUtil
  1437.                   endm
  1438.  
  1439.     ENDIF    ; ...already included